![]() |
KCFindInternetPassword |
||||
Header: | Keychain.h | Carbon status: | Under Evaluation | |
Finds the first Internet password in the default keychain that matches the specified parameters.
OSStatus KCFindInternetPassword ( StringPtr serverName, StringPtr securityDomain, StringPtr accountName, UInt16 port, OSType protocol, OSType authType, UInt32 maxLength, void *passwordData, UInt32 *actualLength, KCItemRef *item );
A pointer to a Pascal string containing the server name. Pass NULL to match any server name.
A pointer to a Pascal string containing the security domain. Pass NULL to match any domain.
A pointer to a Pascal string containing the account name. Pass NULL to match any account name.
The TCP/IP port number. Pass the constant kAnyPort, described in “Default Port Constant”, to match any port.
The protocol associated with this password. See
The authentication scheme used. See
The length of the buffer pointed to by passwordData. Pass 0 if you want to obtain the item reference but not the password data. In this case, you must also pass NULL in the passwordData parameter.
A pointer to a buffer which will hold the returned password data. Before calling KCFindInternetPassword, allocate enough memory for the buffer to hold the data you want to store. Pass NULL if you want to obtain the item reference but not the password data. In this case, you must also pass 0 in the maxLength parameter. On return, a pointer to the returned password data.
On return, the actual length of the password data that was retrieved. If the buffer pointed to by passwordData is smaller than the actual length of the data, KCFindInternetPassword returns the result code errKCBufferTooSmall. In this case, your application must allocate a new buffer of sufficient size before calling KCFindInternetPassword again.
On return, a pointer to a reference to the found item. Pass NULL if you don’t want to obtain this reference.
A result code. The result code errKCNoDefaultKeychain indicates that no default keychain was found. The result code errKCItemNotFound indicates that no matching password item was found. The result code errKCBufferTooSmall indicates that your application must allocate a new buffer of sufficient size before calling KCFindInternetPassword again.
The KCFindInternetPassword function finds the first Internet password item which matches the attributes you provide. The buffer specified in the passwordData parameter must be large enough to hold the password data, otherwise KCFindInternetPassword returns the result code errKCBufferTooSmall. In this case, your application must allocate a new buffer of sufficient size before calling KCFindInternetPassword again. KCFindInternetPassword optionally returns a reference to the found item.
Available beginning with Keychain Manager 1.0. In Keychain Manager 1.0, the kcfindinternetpassword function provides the same functionality as KCFindInternetPassword, except that it accepts C strings rather than Pascal strings as arguments. In Keychain 2.0, you should use KCFindInternetPassword, since kcfindinternetpassword is provided for convenience only and may be removed from the header file at some point in the future.
Under evaluation for Carbon. Available in CarbonLib 1.0 and later when KeychainLib 1.0 or later is installed. Exported by CarbonLib 1.0 and later and by KeychainLib 1.0 and later.
© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)